package com.googlecode.chigs.web.common.wizard;

import org.apache.wicket.extensions.wizard.Wizard;
import org.apache.wicket.extensions.wizard.WizardButton;
import org.apache.wicket.extensions.wizard.WizardButtonBar;
import org.apache.wicket.markup.html.image.Image;

import com.googlecode.chigs.web.common.IconFactory;

public class DefaultWizardButtonBar extends WizardButtonBar {
	public DefaultWizardButtonBar(String id, Wizard wizard) {
		this(id, wizard, true);		
	}

	public DefaultWizardButtonBar(String id, Wizard wizard, boolean editable) {
		super(id, wizard);
		((WizardButton)get("previous")).add(new Image("icon", IconFactory.createArrow180IconReference()));
		((WizardButton)get("next")).add(new Image("icon", IconFactory.createArrowIconReference()));
		((WizardButton)get("last")).add(new Image("icon", IconFactory.createArrowSkipIconReference()));
		((WizardButton)get("finish")).add(new Image("icon", IconFactory.createOkIconReference()));
		((WizardButton)get("cancel")).add(new Image("icon", IconFactory.createCancelIconReference()));
		
		if (!editable) {
			get("finish").setVisible(false);
		}
	}
}
